﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.Sql;

public partial class News : System.Web.UI.Page
{
    VPINews.BLL.News bll_news = new VPINews.BLL.News();
    VPINews.Model.News mod_news = new VPINews.Model.News();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            string NewsID = Request.Params["NewsID"].ToString();
            getnews(NewsID);
        }
    }

    private void getnews(string NewsID)
    {
        int newsID = Convert.ToInt32(NewsID.ToString());
        VPINews.BLL.News bll_news = new VPINews.BLL.News();
        VPINews.Model.News mod_news = bll_news.GetModel(newsID);

        this.lblTitle.Text = mod_news.Title.ToString().Trim();
        this.lblcontents.Text = mod_news.Contents.ToString().Trim();
        this.lblauthor.Text = mod_news.Author.ToString().Trim();
        this.lblpubdate.Text = mod_news.PubDate.ToString().Trim();
        this.lblclicked.Text = mod_news.Clicked.ToString().Trim();

    }
}
